home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / bestl232 / !best003.c < prev    next >
C/C++ Source or Header  |  1994-04-12  |  18KB  |  460 lines

  1. /*==========================================================================
  2.  *
  3.  *  !BEST003.C                                       Tuesday, April 12, 1994
  4.  *
  5.  *  640x480x16 graphics mode windows routines
  6.  *  supplementary source file 3 for The BESTLibrary
  7.  *
  8.  *  Authored independently by George Vanous
  9.  *
  10.  *==========================================================================*/
  11.  
  12.  
  13. /* ------------------------------------------------------------------------ */
  14. /* ----------------------------  INCLUDE FILES  --------------------------- */
  15.  
  16. #include <alloc.h>
  17. #include <stdlib.h>
  18. #include <graphics.h>
  19. #include "!bestlib.h"                  // include !BESTLIB.H in compilation
  20.  
  21. /* ------------------------------------------------------------------------ */
  22. /* -------------------------  GLOBAL DEFINITIONS  ------------------------- */
  23.  
  24. extern mousedata msdata;
  25. extern asciiscan key;
  26. extern char *textstring;
  27.  
  28. /* ------------------------------------------------------------------------ */
  29.  
  30.  
  31. /*----------------------------------------------------------------------------
  32.  * Pop up a column in 640x480x16 graphics mode.
  33.  *
  34.  * [see !BESTLIB.DOC for a description of each parameter]
  35.  * [see !BESTLIB.DOC for a description of the return values]
  36.  */
  37. int _16_popupcolumn(int x, int y, int choice, int maxmenus, char *ptr[], int ms)
  38. {
  39.   #define MAXDATA 20                      // maximum number of menu options
  40.   #define BORDERTHICKNESS 3            // thickness of border in pixels
  41.   #define BORDERCOLOR YELLOW           // color of surrounding border
  42.   #define INNERXSPACE 3                // space between left border and text
  43.   #define INNERYSPACE 2                // space between top border and text
  44.   #define INTERSPACE 33                // space between horizontal submenus
  45.   #define INNERCOLOR BLUE              // inner color of menu
  46.   #define FILLSTYLE 1                  // fill pattern of inner menu
  47.   #define TEXTCOLOR YELLOW             // color of text
  48.   #define INACTIVECOLOR LIGHTRED       // color of inactive text
  49.   #define BARCOLOR WHITE               // color of choosebar
  50.   int barx, bary,
  51.       barlength,
  52.       flength, fheight,
  53.       textx, texty,
  54.       height = 0, length = 0;
  55.   imagedata *menubg;
  56.   register int i, ii;
  57.  
  58.   choice--;
  59.   for (i = 0; i < maxmenus; i++) {
  60.     if (textwidth(ptr[i]) > length) length = textwidth(ptr[i]);
  61.     if (textheight(ptr[i]) > height) height = textheight(ptr[i]);
  62.   }
  63.   height++;
  64.   fheight = height * maxmenus + BORDERTHICKNESS * 2 + INNERYSPACE * 2,
  65.   flength = length + BORDERTHICKNESS * 2 + INNERXSPACE * 2;
  66.   if ((menubg = (void *) malloc(_16_i_need(flength, fheight))) == NULL)
  67.     return(-1);                        // return code for error
  68.   _16_i_save(x, y, flength, fheight, menubg, FALSE, TRUE);
  69.   for (i = 0; i < BORDERTHICKNESS; i++)
  70.     _16_boxoutline(x + i, y + i, flength - i - i, fheight - i - i, BORDERCOLOR, COPY_IMAGE);
  71.  
  72.   _16_boxfill(x + i, y + i, flength - i - i, fheight - i - i, BLACK, COPY_IMAGE);
  73.   textx = x + BORDERTHICKNESS + INNERXSPACE,
  74.   texty = y + BORDERTHICKNESS + INNERYSPACE;
  75.   setfillstyle(FILLSTYLE, INNERCOLOR);
  76.   floodfill(textx, texty, BORDERCOLOR);
  77.   setcolor(TEXTCOLOR);
  78.   for (ii = texty - 1, i = 0; i < maxmenus; ii += height, i++)
  79.     outtextxy(textx, ii, ptr[i]);
  80.   barlength = length + INNERXSPACE * 2,
  81.   fheight -= BORDERTHICKNESS,
  82.   barx = textx - INNERXSPACE,
  83.   bary = texty + choice * height;
  84.  
  85.   if (ms) {
  86.     msdata.pos[0] = msdata.npos[0] = MAXX / 2,
  87.     msdata.pos[1] = msdata.npos[1] = MAXY / 2;
  88.     ms_set(msdata.pos[0], msdata.pos[1]);
  89.   }
  90.  while (TRUE)
  91.  {
  92.    _16_boxfill(barx, bary, barlength, height, BARCOLOR, XOR_IMAGE);
  93.    key.ascii = key.scan = 0;
  94.    if (ms) while (TRUE) {
  95.      if (keyhit()) {
  96.        getchr();
  97.        break;
  98.      }
  99.      ms_stat();
  100.      if (msdata.buts[0] != msdata.nbuts[0]) {
  101.        msdata.buts[0] = msdata.nbuts[0];
  102.        if (!msdata.nbuts[0]) { key.ascii = 13; break; }
  103.      }
  104.      if (msdata.buts[1] != msdata.nbuts[1]) {
  105.        msdata.buts[1] = msdata.nbuts[1];
  106.        if (!msdata.nbuts[1]) { key.ascii = 27; break; }
  107.      }
  108.      if (abs(length = msdata.npos[0] - msdata.pos[0]) > 40) {
  109.        if (length > 0) key.scan = 'M';
  110.        else key.scan = 'K';
  111.        msdata.pos[0] = msdata.npos[0] = MAXX / 2,
  112.        msdata.pos[1] = msdata.npos[1] = MAXY / 2;
  113.        ms_set(msdata.pos[0], msdata.pos[1]);
  114.        break;
  115.      }
  116.      if (abs(length = msdata.npos[1] - msdata.pos[1]) > 10) {
  117.        if (length > 0) key.scan = 'P';
  118.        else key.scan = 'H';
  119.        msdata.pos[0] = msdata.npos[0] = MAXX / 2,
  120.        msdata.pos[1] = msdata.npos[1] = MAXY / 2;
  121.        ms_set(msdata.pos[0], msdata.pos[1]);
  122.        break;
  123.      }
  124.    }
  125.    else
  126.      getchr();
  127.    _16_boxfill(barx, bary, barlength, height, BARCOLOR, XOR_IMAGE);
  128.    if (key.ascii == 9 || key.ascii == 13 || key.ascii == 27) {
  129.      if (key.ascii == 9 || key.ascii == 27) choice = -1;
  130.      break;
  131.    }                                   // 'H' = 1, 'P' = 4
  132.    if (key.scan == 'H') {
  133.      if (--choice < 0) choice = maxmenus - 1, bary = texty + height * (maxmenus - 1);
  134.      else bary -= height;
  135.    }
  136.    else if (key.scan == 'P') {
  137.      if (++choice == maxmenus) choice = 0, bary = texty;
  138.      else bary += height;
  139.    }
  140.  }
  141.   _16_i_show(x, y, menubg, COPY_IMAGE);
  142.   free(menubg);
  143.   return(++choice);
  144. }
  145.  
  146. /*----------------------------------------------------------------------------
  147.  * Pop up a menu in 640x480x16 graphics mode.
  148.  *
  149.  * [see !BESTLIB.DOC for a description of each parameter]
  150.  * [see !BESTLIB.DOC for a description of the return values]
  151.  */
  152. int _16_popupmenu(int x, int y, int choice, int maxmenus, char *ptr[], int data[][3], char *text[], int ms)
  153. {
  154.   #define MAXDATA 20                  // maximum number of menu options
  155.   #define BORDERTHICKNESS 3           // thickness of border in pixels
  156.   #define BORDERCOLOR YELLOW          // color of surrounding border
  157.   #define INNERXSPACE 3               // space between left border and text
  158.   #define INNERYSPACE 2               // space between top border and text
  159.   #define INTERSPACE 33               // space between horizontal submenus
  160.   #define INNERCOLOR BLUE             // inner color of menu
  161.   #define FILLSTYLE 1                 // fill pattern of inner menu
  162.   #define TEXTCOLOR YELLOW            // color of text
  163.   #define INACTIVECOLOR LIGHTRED      // color of inactive text
  164.   #define BARCOLOR WHITE              // color of choosebar
  165.   int datalength[MAXDATA] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
  166.   int a, b, bgx, bgy, bx, barx, bary, barlength, choicex = 0,
  167.       length, flength, height, fheight, textx, texty;
  168.   imagedata *bg, *bg2, *menubg;
  169.   register int i, ii;
  170.  
  171.   choice--;
  172.   for (a = i = 0; i < maxmenus; i++) {
  173.     for (ii = 0; ii < data[i][0]; ii++) {
  174.       if (!data[i][1])
  175.         datalength[i] = 0;
  176.       else
  177.         datalength[i] += textwidth( text[ data[i][1] + ii] ) + INTERSPACE;
  178.     }
  179.     if (datalength[i] > a)
  180.       a = datalength[i];
  181.   }
  182.   for (b = i = ii = 0; i < maxmenus; i++) {
  183.     if (textwidth(ptr[i]) > ii)
  184.       ii = length = textwidth(ptr[i]);
  185.     if (textheight(ptr[i]) > b)
  186.       b = height = textheight(ptr[i]);
  187.   }
  188.   height++;
  189.   bg = (void *) malloc(_16_i_need(a + BORDERTHICKNESS * 2, height + BORDERTHICKNESS * 2 + INNERYSPACE * 2));
  190.   bg2 = (void *) malloc(_16_i_need(BORDERTHICKNESS, height + BORDERTHICKNESS * 2 + INNERYSPACE * 2));
  191.   fheight = height * maxmenus + BORDERTHICKNESS * 2 + INNERYSPACE * 2,
  192.   flength = length + BORDERTHICKNESS * 2 + INNERXSPACE * 2;
  193.   menubg = (void *) malloc(_16_i_need(flength, fheight));
  194.   if (menubg == NULL || bg2 == NULL || bg == NULL) {
  195.     if (bg != NULL) free(bg);
  196.     if (bg2 != NULL) free(bg2);
  197.     if (menubg != NULL) free(menubg);
  198.     return(-1);                        // return code for error
  199.   }
  200.   _16_i_save(x, y, flength, fheight, menubg, FALSE, TRUE);
  201.   for (i = 0; i < BORDERTHICKNESS; i++)
  202.     _16_boxoutline(x + i, y + i, flength - i - i, fheight - i - i, BORDERCOLOR, COPY_IMAGE);
  203.  
  204.   _16_boxfill(x + i, y + i, flength - i - i, fheight - i - i, BLACK, COPY_IMAGE);
  205.   textx = x + BORDERTHICKNESS + INNERXSPACE,
  206.   texty = y + BORDERTHICKNESS + INNERYSPACE;
  207.   setfillstyle(FILLSTYLE, INNERCOLOR);
  208.   floodfill(textx, texty, BORDERCOLOR);
  209.   setcolor(TEXTCOLOR);
  210.   for (b = texty - 1, i = 0, ii = 0x0001; i < maxmenus; b += height, i++, ii = ii << 1) {
  211.     if (ii & (unsigned int)text[0])
  212.       setcolor(TEXTCOLOR);
  213.     else
  214.       setcolor(INACTIVECOLOR);
  215.     outtextxy(textx, b, ptr[i]);
  216.   }
  217.   setcolor(TEXTCOLOR);
  218.  
  219.   barlength = length + INNERXSPACE * 2,
  220.   fheight -= BORDERTHICKNESS,
  221.   barx = textx - INNERXSPACE,
  222.   bary = texty + choice * height;
  223.  
  224.   for (i = ii = 1; i < choice + 1; i++) ii = ii << 1;
  225.   for (i = 0; i < maxmenus; i++, ii = ii << 1, bary += height, choice++)
  226.     if (ii & (unsigned int)text[0]) break;
  227.   if (i == maxmenus) return(-1);
  228.  
  229.   bgx = barx + barlength + BORDERTHICKNESS,
  230.   bgy = bary - BORDERTHICKNESS - INNERYSPACE,
  231.   flength = datalength[choice] + BORDERTHICKNESS * 2,
  232.   fheight = height + BORDERTHICKNESS * 2 + INNERYSPACE * 2;
  233.   _16_i_save(bgx, bgy, flength, fheight, bg, FALSE, TRUE);
  234.   if (data[choice][1]) {
  235.     b = bgx - BORDERTHICKNESS * 2;
  236.     _16_i_save(b, bgy, BORDERTHICKNESS, fheight, bg2, FALSE, TRUE);
  237.     for (i = 0; i < BORDERTHICKNESS; i++)
  238.       _16_boxoutline(b + i, bgy + i, flength - i - i + BORDERTHICKNESS, fheight - i - i, BORDERCOLOR, COPY_IMAGE);
  239.     _16_boxfill(b + i, bgy + BORDERTHICKNESS, flength - i, fheight - BORDERTHICKNESS * 2, BLACK, COPY_IMAGE);
  240.     floodfill(b + i, bgy + BORDERTHICKNESS, BORDERCOLOR);
  241.     _16_i_show(b, bgy, bg2, COPY_IMAGE);
  242.  
  243.     b = barx + barlength + BORDERTHICKNESS + INTERSPACE / 2;
  244.     for (i = 0, ii = 0x0001; i < data[choice][0]; i++, ii = ii << 1) {
  245.       if (ii & (unsigned int)data[choice][2])
  246.         setcolor(TEXTCOLOR);
  247.       else
  248.         setcolor(INACTIVECOLOR);
  249.       outtextxy(b, bary - 1, text[ data[choice][1] + i ]);
  250.       b += textwidth(text[ data[choice][1] + i ]) + INTERSPACE;
  251.     }
  252.   }
  253.   a = barx, bx = barlength;
  254.   if (ms) {
  255.     msdata.pos[0] = msdata.npos[0] = MAXX / 2,
  256.     msdata.pos[1] = msdata.npos[1] = MAXY / 2;
  257.     ms_set(msdata.pos[0], msdata.pos[1]);
  258.   }
  259.  while (TRUE)
  260.  {
  261.   _16_boxfill(barx, bary, barlength, height, BARCOLOR, XOR_IMAGE);
  262.   key.ascii = key.scan = 0;
  263.   if (ms) while (TRUE) {
  264.     if (keyhit()) {
  265.       getchr();
  266.       break;
  267.     }
  268.     ms_stat();
  269.     if (msdata.buts[0] != msdata.nbuts[0]) {
  270.       msdata.buts[0] = msdata.nbuts[0];
  271.       if (!msdata.nbuts[0]) {
  272.         key.ascii = 13;
  273.         break;
  274.       }
  275.     }
  276.     if (msdata.buts[1] != msdata.nbuts[1]) {
  277.       msdata.buts[1] = msdata.nbuts[1];
  278.       if (!msdata.nbuts[1]) { key.ascii = 27; break; }
  279.     }
  280.     if (abs(length = msdata.npos[0] - msdata.pos[0]) > 40) {
  281.       if (length > 0) key.scan = 'M';
  282.       else key.scan = 'K';
  283.       msdata.pos[0] = msdata.npos[0] = MAXX / 2,
  284.       msdata.pos[1] = msdata.npos[1] = MAXY / 2;
  285.       ms_set(msdata.pos[0], msdata.pos[1]);
  286.       break;
  287.     }
  288.     if (abs(length = msdata.npos[1] - msdata.pos[1]) > 10) {
  289.       if (length > 0) key.scan = 'P';
  290.       else key.scan = 'H';
  291.       msdata.pos[0] = msdata.npos[0] = MAXX / 2,
  292.       msdata.pos[1] = msdata.npos[1] = MAXY / 2;
  293.       ms_set(msdata.pos[0], msdata.pos[1]);
  294.       break;
  295.     }
  296.   }
  297.   else
  298.     getchr();
  299.   _16_boxfill(barx, bary, barlength, height, BARCOLOR, XOR_IMAGE);
  300.   if (key.ascii == 9 || key.ascii == 13 || key.ascii == 27) {
  301.     if (key.ascii == 9 || key.ascii == 27)
  302.       choice = -1, choicex = 0;
  303.     break;
  304.   }                          // 'H' = 1, 'K' = 2, 'M' = 3, 'P' = 4
  305.   if (key.scan == 'H') {
  306.     barx = a, barlength = bx, choicex = 0;
  307.     if (--choice < 0) choice = maxmenus - 1, bary = texty + height * (maxmenus - 1);
  308.     else bary -= height;
  309.  
  310.     for (i = ii = 1; i < choice + 1; i++) ii = ii << 1;
  311.     for (i = 0; ; i++) {
  312.       if (ii & (unsigned int)text[0]) break;
  313.       if (--choice < 0) {
  314.         choice = maxmenus - 1,
  315.         bary = texty + height * choice;
  316.         for (i = ii = 1; i < maxmenus; i++) ii = ii << 1;
  317.         i = 0;
  318.         continue;
  319.       }
  320.       else bary -= height, ii = ii >> 1;
  321.     }
  322.     _16_i_show(bgx, bgy, bg, COPY_IMAGE);
  323.     _16_boxfill(bgx - BORDERTHICKNESS, bgy, BORDERTHICKNESS, fheight, BORDERCOLOR, COPY_IMAGE);
  324.     if (data[choice][1]) {
  325.       bgx = barx + barlength + BORDERTHICKNESS,
  326.       bgy = bary - BORDERTHICKNESS - INNERYSPACE,
  327.       flength = datalength[choice] + BORDERTHICKNESS * 2;
  328.       _16_i_save(bgx, bgy, flength, fheight, bg, FALSE, TRUE);
  329.       b = bgx - BORDERTHICKNESS * 2;
  330.       _16_i_save(b, bgy, BORDERTHICKNESS, fheight, bg2, FALSE, TRUE);
  331.       for (i = 0; i < BORDERTHICKNESS; i++)
  332.         _16_boxoutline(b + i, bgy + i, flength - i - i + BORDERTHICKNESS, fheight - i - i, BORDERCOLOR, COPY_IMAGE);
  333.       _16_boxfill(b + i, bgy + BORDERTHICKNESS, flength - i, fheight - BORDERTHICKNESS * 2, BLACK, COPY_IMAGE);
  334.       floodfill(b + i, bgy + BORDERTHICKNESS, BORDERCOLOR);
  335.       _16_i_show(b, bgy, bg2, COPY_IMAGE);
  336.  
  337.       b = barx + barlength + BORDERTHICKNESS + INTERSPACE / 2;
  338.       for (i = 0, ii = 0x0001; i < data[choice][0]; i++, ii = ii << 1) {
  339.         if (ii & (unsigned int)data[choice][2])
  340.           setcolor(TEXTCOLOR);
  341.         else
  342.           setcolor(INACTIVECOLOR);
  343.         outtextxy(b, bary - 1, text[ data[choice][1] + i ]);
  344.         b += textwidth(text[ data[choice][1] + i ]) + INTERSPACE;
  345.       }
  346.     }
  347.     choicex = 0;
  348.   }
  349.   else if (key.scan == 'P') {
  350.     barx = a, barlength = bx, choicex = 0;
  351.     if (++choice == maxmenus) choice = 0, bary = texty;
  352.     else bary += height;
  353.  
  354.     for (i = ii = 1; i < choice + 1; i++) ii = ii << 1;
  355.     for (i = 0; ; i++) {
  356.       if (ii & (unsigned int)text[0]) break;
  357.       if (++choice == maxmenus) {
  358.         choice = 0, bary = texty, ii = 1, i = 0;
  359.         continue;
  360.       }
  361.       else bary += height, ii = ii << 1;
  362.     }
  363.     _16_i_show(bgx, bgy, bg, COPY_IMAGE);
  364.     _16_boxfill(bgx - BORDERTHICKNESS, bgy, BORDERTHICKNESS, fheight, BORDERCOLOR, COPY_IMAGE);
  365.     if (data[choice][1]) {
  366.       bgx = barx + barlength + BORDERTHICKNESS,
  367.       bgy = bary - BORDERTHICKNESS - INNERYSPACE,
  368.       flength = datalength[choice] + BORDERTHICKNESS * 2;
  369.       _16_i_save(bgx, bgy, flength, fheight, bg, FALSE, TRUE);
  370.       b = bgx - BORDERTHICKNESS * 2;
  371.       _16_i_save(b, bgy, BORDERTHICKNESS, fheight, bg2, FALSE, TRUE);
  372.       for (i = 0; i < BORDERTHICKNESS; i++)
  373.         _16_boxoutline(b + i, bgy + i, flength - i - i + BORDERTHICKNESS, fheight - i - i, BORDERCOLOR, COPY_IMAGE);
  374.       _16_boxfill(b + i, bgy + BORDERTHICKNESS, flength - i, fheight - BORDERTHICKNESS * 2, BLACK, COPY_IMAGE);
  375.       floodfill(b + i, bgy + BORDERTHICKNESS, BORDERCOLOR);
  376.       _16_i_show(b, bgy, bg2, COPY_IMAGE);
  377.  
  378.       b = barx + barlength + BORDERTHICKNESS + INTERSPACE / 2;
  379.       for (i = 0, ii = 0x0001; i < data[choice][0]; i++, ii = ii << 1) {
  380.         if (ii & (unsigned int)data[choice][2])
  381.           setcolor(TEXTCOLOR);
  382.         else
  383.           setcolor(INACTIVECOLOR);
  384.         outtextxy(b, bary - 1, text[ data[choice][1] + i ]);
  385.         b += textwidth(text[ data[choice][1] + i ]) + INTERSPACE;
  386.       }
  387.     }
  388.     choicex = 0;
  389.   }
  390.   else if (key.scan == 'K') { if (data[choice][1]) {
  391.     switch(choicex) {
  392.      case 0:
  393.       _16_boxfill(bgx - BORDERTHICKNESS, bgy, BORDERTHICKNESS, fheight, BORDERCOLOR, COPY_IMAGE);
  394.      case 1:
  395.       choicex = data[choice][0],
  396.       barx = a + bx + BORDERTHICKNESS + datalength[choice] - textwidth(text[ data[choice][1] + choicex - 1 ]) - INTERSPACE;
  397.       break;
  398.      default:
  399.       choicex--,
  400.       barx -= textwidth(text[ data[choice][1] + choicex - 1 ]) + INTERSPACE;
  401.     }
  402.     for (i = ii = 1; i < choicex; i++)
  403.       ii = ii << 1;
  404.     for (b = i = 0; b != data[choice][0]; i++, b++) {
  405.       if (ii & (unsigned int)data[choice][2]) break;
  406.       if (--choicex < 1) {
  407.         choicex = data[choice][0],
  408.         barx = a + bx + BORDERTHICKNESS + datalength[choice] - textwidth(text[ data[choice][1] + choicex - 1 ]) - INTERSPACE;
  409.         for (i = ii = 1; i < data[choice][0]; i++) ii = ii << 1;
  410.         i = 0;
  411.         continue;
  412.       }
  413.       else
  414.         ii = ii >> 1,
  415.         barx -= textwidth(text[ data[choice][1] + choicex - 1 ]) + INTERSPACE;
  416.     }
  417.     if (b == data[choice][0])
  418.       barx = a, barlength = bx, choicex = 0;
  419.     else
  420.       barlength = textwidth(text[ data[choice][1] + choicex - 1 ]) + INTERSPACE;
  421.   } }
  422.   else if (key.scan == 'M') if (data[choice][1]) {
  423.     if (!choicex) {
  424.        _16_boxfill(bgx - BORDERTHICKNESS, bgy, BORDERTHICKNESS, fheight, BORDERCOLOR, COPY_IMAGE);
  425.        choicex = 0, barx = a + bx + BORDERTHICKNESS;
  426.     }
  427.     else if (choicex == data[choice][0])
  428.       choicex = 0, barx = a + bx + BORDERTHICKNESS;
  429.     else
  430.       barx += textwidth(text[ data[choice][1] + choicex - 1 ]) + INTERSPACE;
  431.  
  432.     for (i = ii = 1; i < choicex + 1; i++)
  433.       ii = ii << 1;
  434.     for (b = i = 0; b != data[choice][0]; i++, b++) {
  435.       if (ii & (unsigned int)data[choice][2]) break;
  436.       if (++choicex == data[choice][0]) {
  437.         choicex = 0, barx = a + bx + BORDERTHICKNESS,
  438.         ii = 0x0001, i = 0;
  439.         continue;
  440.       }
  441.       else
  442.         ii = ii << 1,
  443.         barx += textwidth(text[ data[choice][1] + choicex - 1 ]) + INTERSPACE;
  444.     }
  445.     if (b == data[choice][0])
  446.       barx = a, barlength = bx, choicex = 0;
  447.     else
  448.       barlength = textwidth(text[ data[choice][1] + choicex++ ]) + INTERSPACE;
  449.   }
  450.  }
  451.   _16_i_show(x, y, menubg, COPY_IMAGE);
  452.   _16_i_show(bgx, bgy, bg, COPY_IMAGE);
  453.   free(menubg);
  454.   free(bg2);
  455.   free(bg);
  456.   return(choicex | (++choice << 4));
  457. }
  458.  
  459. /*==============================  END-OF-FILE  =============================*/
  460.